package myThread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class demo32 {
    public static void main(String[] args) {
        ExecutorService threadPool = Executors.newFixedThreadPool(4);
        //ExecutorService threadPool = Executors.newCachedThreadPool();
        for(int i = 0;i<1000;i++){
            int id = i;
            threadPool.submit(()->{
                System.out.println("hello "+id + Thread.currentThread().getName());
            });
        }
        threadPool.shutdown();

    }
}
